<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>我要好发网 </title>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <link href="/www/css/a.css" rel="stylesheet" type="text/css"/>
  <link href="/www/css/reset.css" rel="stylesheet" type="text/css"/>
  <script type="text/javascript" src="/www/js/jquery.js"></script>
  <script type="text/javascript" src="/www/js/w.js"></script>
 </head>

 <body>
	<div id="header" class="clearfix">
		<div class="lw">
			<div class="top clearfix">
				<a class="logo left" href="/">我要好发网</a>
				<a href="javascript:" onclick="addToFavorite()" title="加入收藏夹" class="favorite right">收藏我要好发网</a>
			</div>
			
		</div>
	</div>
	<div id="wrap" class="lw1 clearfix ab">
		<h2 class="menu2 clearfix">
			<span>话题列表</span>
		</h2>
		<?if($topic):?>
		<table class="discuz">
			<tr>
				<th class="table-left" class="t1">话题</th>
				<th class="t3">回复/浏览</th>
				<th class="t3">作者</th>
				<th class="t3">时间</th>
			</tr>
			<?foreach($topic as $t):?>
			<tr>
				<td class="table-left" class="t1"><a href="/topic/show/<?=$t->id?>"><?=$t->title?></a></td>
				<td class="t3"><?=$t->reply_num?>/<?=$t->view_num?></td>
				<td class="t3"><?=$t->uname?></td>
				<td class="t3"><?=$t->time?></td>
			</tr>
			<?endforeach?>
		</table>
		<p>共<?=$topic_num?>个话题</p>
		<?else:?>
			<p>还没有话题</p>
		<?endif?>

		<?php echo $page;?>
		<?if($this->auth->loged):?>
		<form action="" method="post" id="topic-form"class="form2" onsubmit="return false;">
			<div class="form-item">
				<div class="top">
					<label for="content">发表话题</label>
				</div>
				<div class="item">
					<div class="form-right-label">
						<label for="tc_title">话题标题</label>
					</div>
					<div class="form-right-text off">
						<input type="text" class="text w1" id="tc_title" value=""name="tc_title" />
						<span class="form-border-right"></span>
					</div>
				</div>
				<div class="item">
					<div class="form-right-label">
						<label for="tc_cont">话题内容</label>
					</div>
					<div class="form-textarea-item tr-off clearfix">
						<textarea name="tc_cont" id="tc_cont" class="textarea"></textarea>
						<span class="form-border-right"></span>
					</div>
					</div>

				<div class="footer clearfix">
					<input type="submit" class="button" value="发表看法" onclick="add_topic(<?=$p->id?>)" />
					<input type="reset" class="cancel" value="取消" />
				</div>
			</div>
		</form>
		<?else:?>
			<p class="do">请先 <a href="/sign/in?url=/topic/more/<?=$p->id?>#topic-form">登录</a>，再发表话题</p>
		<?endif?>
	</div>
<?$this->load->view('footer.tpl');?>